<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = ['red', 'gree', 'blue', 'pink', 'blake'];
        console.log(arr.length);//获取数组长度5,s所以i<5
        for (var i = 0; i < 5; i++) {
            console.log(arr[i]);
        }
        //练习
        var arr1 = ['r', 'g', 'b', 'p', 'b'];
        for (var i = 0; i < arr1.length; i++) {
            console.log(arr1[i]);
        }
    </script>
</head>

<body>

</body>

</html>